{extend name="layout/base" /} {block name="main"}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">文章列表</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:location.reload();" class="am-icon-refresh" title="刷新"></a>
                    </div>
                </div>
                <div class="widget-body  widget-body-lg am-fr">
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <a href="{:url('tadmin.advertising.edit')}" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</a>
                                    <a href="{:url('tadmin.advertising.block')}" class="am-btn am-btn-default am-btn-primary"><span class="am-icon-bars"></span> 广告位</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-6">
                        <form class="am-form-inline tpl-form-border-form cl-p am-fr" role="form">
                            <select name="block[]" multiple data-am-selected="{btnSize: 'sm',searchBox: 1, maxHeight: 300}">
                                {foreach $adBlocks as $block}
                                <option value="{$block.block}" {if is_array($Request.get.block) && in_array($block.block, $Request.get.block)}selected{/if}>{$block.name}</option>
                                {/foreach}
                            </select>
                            <div class="am-form-group">
                                <input name="keywords" type="text" class="am-form-field " placeholder="文章标题" value="{$Request.get ? $Request.get.keywords : ''}">
                            </div>
                            <button type="submit" class="am-btn am-btn-primary am-btn-sm">搜索</button>
                        </form>
                    </div>
                    <div class="am-u-sm-12 am-scrollable-horizontal ">
                        <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black am-text-middle" id="example-r">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>广告位</th>
                                    <th>标题</th>
                                    <th>时间</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                {foreach $advertisings as $ad}
                                <tr class="gradeX">
                                    <td>{$ad.id}</td>
                                    <td>{$ad.advertisingBlock.name}</a></td>
                                    <td>
                                        <div class="image-title-group">
                                            <img src="{$ad.image ?? ''}" class="error-nopic" />
                                            <p><strong>{$ad.title ?? ''}</strong></p>
                                        </div>
                                    </td>
                                    <td>{$ad.created_at ?? ''}</td>
                                    <td><span class="show-status" data-status="{$ad.status}"><i class="am-icon-circle"></i></span></td>
                                    <td>
                                        <div class="tpl-table-black-operation">
                                            <a href="{:url('tadmin.advertising.edit')}?id={$ad.id}">
                                                <i class="am-icon-pencil"></i> 编辑
                                            </a>
                                            <a href="{:url('tadmin.advertising.delete')}?id={$ad.id}" class="tpl-table-black-operation-del">
                                                <i class="am-icon-trash"></i> 删除
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}
                                <!-- more data -->
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr">
                            {$advertisings|raw}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}